﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SageKing.OpenIddict.Resource.Features;
using SageKing.OpenIddictResource.Api;

namespace SageKing.Extensions;

public static class ModuleExtensions
{
    public static IServiceCollection AddRoutePrefixAllControllers(
      this IServiceCollection Services,
      string routePrefix = "api/"
    )
    {
        Services.AddControllers(options =>
         {
             options.UseOpenIddictUIRoutePrefix(
               routePrefix,
               [
                 typeof(SysConfigController),
               ]
             );
         });

        return Services;
    }
}
